package org.hxzon.project;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

@MappedSuperclass
@DynamicInsert
@DynamicUpdate
public class SimpleEntity implements Serializable {

    private static final long serialVersionUID = -5342595206501703154L;

    public static final int DefineIdSize = 32;
    public static final int DefineSize32 = 32;
    public static final int DefineSize64 = 64;
    public static final int DefineSize128 = 128;
    public static final int DefineSize256 = 256;
    public static final int DefineSize512 = 512;
    public static final int DefineSize1024 = 1024;
    public static final int DefineSize2048 = 2048;
    public static final String DefineVarchar32 = "varchar(32) default ''";
    public static final String DefineVarchar64 = "varchar(64) default ''";
    public static final String DefineVarchar128 = "varchar(128) default ''";
    public static final String DefineVarchar256 = "varchar(256) default ''";
    public static final String DefineVarchar512 = "varchar(512) default ''";
    public static final String DefineVarchar1024 = "varchar(1024) default ''";
    public static final String DefineVarchar2048 = "varchar(2048) default ''";

    @Id
    @GeneratedValue(generator = "hibernateuuid")
    @GenericGenerator(name = "hibernateuuid", strategy = "uuid")
    @Column(length = DefineIdSize)
    private String id;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

}
